//
//  AXHomePtsfxICultureCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/2.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXHomePtsfxICultureCell.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"
#import "UITableView+SDAutoTableViewCellHeight.h"

@implementation AXHomePtsfxICultureCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    /** 产品图片 */
    self.productImageView = [[UIImageView alloc]init];
    self.productImageView.contentMode =UIViewContentModeScaleAspectFill;
    self.productImageView.clipsToBounds=YES;//
    [self.contentView addSubview:self.productImageView];
    /** 标题 */
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textColor = COLOR_Gray;
    self.titleLabel.numberOfLines = 2;
    self.titleLabel.font = FONT_FOURTEEN;;
    [self.contentView addSubview:self.titleLabel];
    
    /** 内容 */
    self.contentLabel = [[UILabel alloc]init];
    self.contentLabel.font = FONT_FOURTEEN;
    self.contentLabel.textColor = COLOR_Gray;
    [self.contentView addSubview:self.contentLabel];
   
    
    
    
    
}

- (void)setlayout {
    
    self.productImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(120)
    .heightIs(100);
    
    self.titleLabel.sd_layout
    .leftSpaceToView(self.productImageView, 10)
    .topSpaceToView(self.contentView, 10)
    .rightSpaceToView(self.contentView, 10)
    .autoHeightRatio(0)
    .minHeightIs(40);
    
    self.contentLabel.sd_layout
    .leftEqualToView(self.titleLabel)
    .topSpaceToView(self.titleLabel, 10)
    .rightSpaceToView(self.contentView, 10)
    .autoHeightRatio(0)
    .minHeightIs(40);
    
    
    
    
    
    /** cell 自适应第一步 */
    [self setupAutoHeightWithBottomView:self.contentLabel bottomMargin:10];
    
}

@end
